package com.elitedatai.mchtest.mission.enums;


public enum PlanStatus {

    PENDING(0, "待执行"),
    EXECUTING(1, "执行中"),
    COMPLETED(2, "已完成"),
    UNKNOWN(-1, "Unknown");

    private int val;

    private String desc;

    PlanStatus(int val, String desc) {
        this.val = val;
        this.desc = desc;
    }

    public int getVal() {
        return this.val;
    }

    public String getDesc() {
        return this.desc;
    }

    public static PlanStatus find(int val) {
        if (val == PENDING.val) {
            return PENDING;
        }
        if (val == EXECUTING.val) {
            return EXECUTING;
        }
        if (val == COMPLETED.val) {
            return COMPLETED;
        }
        return UNKNOWN;
    }
}
